home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _WordDocPropertyGet.au3 < prev    next >
Text File  |  2007-09-08  |  1KB  |  23 lines

  1. ; *******************************************************
  2. ; Example 1 - Create a word window, open a document,
  3. ;                then read all available document properties by index
  4. ; *******************************************************
  5. ;
  6. #include <Word.au3>
  7. $oWordApp = _WordCreate (@ScriptDir & "\Test.doc")
  8. $oDoc = _WordDocGetCollection ($oWordApp, 0)
  9. For $i = 1 To 30
  10.     ConsoleWrite("Property Index " & $i & " - " & _WordDocPropertyGet ($oDoc, $i) & @CR)
  11. Next
  12.  
  13. ; *******************************************************
  14. ; Example 2 - Create a word window, open a document,
  15. ;                then read the title, subject, and author properties by name.
  16. ; *******************************************************
  17. ;
  18. #include <Word.au3>
  19. $oWordApp = _WordCreate (@ScriptDir & "\Test.doc")
  20. $oDoc = _WordDocGetCollection ($oWordApp, 0)
  21. ConsoleWrite("Title - " & _WordDocPropertyGet ($oDoc, "Title") & @CR)
  22. ConsoleWrite("Subject - " & _WordDocPropertyGet ($oDoc, "Subject") & @CR)
  23. ConsoleWrite("Author - " & _WordDocPropertyGet ($oDoc, "Author") & @CR)